#ifndef POLYGON_H
#define POLYGON_H

#include "point.h"
#include <vector>
#include <iostream>
#include <fstream>
#include <memory>

typedef std::vector<point> simple_polygon;

struct polygon
{
    polygon(const simple_polygon&);
    polygon();

    sign is_inside(const point&) const;
    sign is_inside_convex_polygon(const point&) const;

    simple_polygon points;
    std::vector<simple_polygon> holes;
private:
    int count_simple(const simple_polygon&, const point&) const;

    struct cmp
    {
        cmp(const point&);
        bool operator() (const point&, const point&) const;

        point start;
    };
};

std::istream& operator >>(std::istream&, simple_polygon&);
std::istream& operator >>(std::istream&, polygon&);
#endif // POLYGON_H
